package com.shop.common.enums.store;

import lombok.Getter;

/**
 * 收入类型
 */
@Getter
public enum StoreOrderStatusEnum {

    NEED_PAY(0, "待支付"),
    REFUND(-40, "已退款"),
    NEED_DELIVERY(10, "待发货"),
    NEED_TAKE_DELIVERY(20, "待收货"),
    NEED_EVALUATION(30, "待评价"),
    COMPLETE(40, "已完成"),
    CANCEL(-50, "已取消"),
    ;

    private int key;
    private String name;

    StoreOrderStatusEnum(int key, String name) {
        this.key = key;
        this.name = name;
    }

    public static StoreOrderStatusEnum val(int key) {
        for (StoreOrderStatusEnum enumObj : StoreOrderStatusEnum.values()) {
            if(enumObj.key == key) {
                return enumObj;
            }
        }
        return null;
    }
}
